package ph.com.gs3.formalistics.model.tables;

import android.database.sqlite.SQLiteDatabase;

public abstract class AbstractDataTable {

	public abstract String[] getTableColumns();

	protected abstract String getCreateTableQuery();

	protected abstract String getTableName();

	public void onCreate(SQLiteDatabase database) {
		database.execSQL(getCreateTableQuery());
	}

	public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
		database.execSQL("DROP TABLE IF EXISTS " + getTableName());
		onCreate(database);
	}

}
